comparing two data structures